
Data in Chunks/Commands is organized into words
Sorted by ID:
---------------------------------------
0x00: End animation
	0x4 bytes long

0x01: Execute previous commands
	0x8 Bytes long
	And do some bookkeeping too?
	Repeat until all previous commands are finished?
	Don't load subsequent commands until that time either

0x02: Conditional Test
	If the conditional fails, skip to the next 0x4 or 0x3 command
	0xC bytes long
	$04: Which $1F130 test to run (see Chunk 0x5)
	$08: Test parameter (if applicable)

0x03: Failed conditional marker 1
	0x04 bytes
	-When this is encountered after a 0x02 fail, execute all of the following chunks until
	an 0x4 is reached

0x04: Failed conditional marker 2
	0x04 bytes
	-used as an end marker for failed 0x02 conditionals
	-Set the next command as the place to begin reading from
	-Used by Kill to skip part of its animation if it fails to inflict Death

0x05:
	-Used to handle spells like Blind that play an effect on individual targets before proceeding with 'main' effect
	-Loops for all 9 monsters or all 4 PCs, depending on who the target is
	0x10 bytes long
	$04: Conditional ID; indexes to a routine jump table
		$1F130
		Run for each target to determine if that target will have the effect played	
		0x00: Return 0x1
		0x01: Return 0x1 for all living targets
		0x02: If caster is a monster, return 0x0; if a PC, return 0x1
		0x03: If target(s) is/are monster(s), return 0x0; if targets are PC, return 0x1
		0x04: Return 0x1 only on targets who are effected by the spell status (for Kill, etc)
		0x05: (same as 0x01)
		0x06: Depending on Encounter ID, returns a variable:
			$0: ID = 0x7B (Chaos)
			$1: ID = 0x75,78 (Kraken-2, Marilith battles)
			$2: ID = 0x73,7A (Lich-2, Lich battles)
			$3: ID = 0x74,79 (Marilith-2, Kraken battles)
			$4: ID = 0x76,77 (Tiamat-2,Tiamat battles)
			$5: ID = 0x7C,0x7D,0x7F (Miniboss battles)
			$6: Everything Else
			$7: 0xFF < ID 0x101 (Soul of Chaos boss battles)
			If this number matches the target ID, return 0x0
	$08: Delay between each iteration
	$0C: Number of subsequent chunks to load
		(these next chunks are applied to every valid target)
		After loading those chunks, a 0x7 Chunk is created, and the delay set to $08's value

0x06, Jump to different script offsets based on conditional
	0x18 bytes
	-If the conditional returns 0x1, choose Branch A; if 0x0, choose Branch B
	$04: Delay
	$08: Conditional ID:
		(similar as for command 0x5)
		0x0: Return 0x1
		0x1: Return 0x1 if unit of (Param) ID is targetable
		0x2: Return 0x1 if caster is a PC
		0x3: Return 0x1 if target(s) are PCs
		0x4: Return 0x1 if target or any among targets had status effect set
		0x5: Return 0x1 if unit of (Param) ID is targetable
		0x6: Check Enc. ID for special type; return 0x1 if equal to (Param)
	$0C: Conditional parameter
	$10: Branch A offset
	$14: Branch B offset
	

0x07, Do something related to the target of animation...
	Don't proceed until this command has finished
	0x8 bytes
	$04: Delay in frames

0x08, Play Sound:
	0xC Bytes
	$04: Sound delay, in frames(?), from when this command is first read
	$08: Sound Effect ID

0x09, ?
	0x10 Bytes
	Something to do with moving tiles converging on a point
	Params affect radius of starting circle, direction/distribution along circle
	Param at 0xC defines something? all following tiles of same type are affected?
	$08: Radius?

0x0A, Animate standing tile
	0x1C Bytes
	$04: Spawn Delay
	$08: animation/gfx pointer, or ID for pre-loaded
		(if no bits in top half are set, treat as ID)
	$0C: Animation frame to spawn at?
	$10: Origin point of GFX:
		0x00: Top-left corner of screen
		0x01: Center of screen
		0x02: Mid-left of screen
		0x03: Just above caster?
		0x04: Caster
		0x05: (First) Target
		0x06: 'Current' target, for multitarget spells?
		0x07: Caster?
	$14: Y-displacement (positive is down), hw
	$16: X-displacement (positive is right), hw
	$18: Same deal as $14 in Chunk 0x17...
		-If 0x10000000, flip horizontally
	

0x0B, pre-load GFX?
	0x10 bytes
	$04: Pointer to compressed tile data
	$08: Some parameter...an identifier?

0x0D, Animate object
	0x20 bytes
	$04: Spawn delay
	$08: TSA/animation pointer, or ID if gfx are pre-loaded
	$0C: Origin point type
	$10: Y-displacement
	$12: X-displacement
	$14: Animation frame to start on/anim mode to use?
	$18: GFX loading flags?
	$1C: Time to hold on last animation frame

0x0F, Animated moving object (straight line)
	0x24 bytes
	$04: Delay
	$08: Tile data pointer?
	$0C: Origin type
	$10: Y starting pos
	$12: X starting pos
	$14: Some layering/zoom param:
		0x10000000: Flip horizontally
	$18: Y-speed; positive values are down, negative are up
	$1A: X-speed; positive values are to the right, negative to the left
	$1C: Index to tile data?
	$20: Time, in frames, this object will last; affects speed as well

0x10, Non-animated moving object (straight line)
	0x24 bytes
	$04: Delay
	$08: Tile data pointer
	$0C: Origin
	$10: Y origin offset
	$12: X origin offset
	$14: Y displacement (total)
	$16: X displacement (total)
	$18: Some sort of layering/zoom param?
		If 0x10000000, flip horizontally?
	$1C: Some sort of index to sprites within a spritesheet?
	$20: Time; number of frames movement will take; lower values = faster, shorter

0x11, Animate moving tile in straight accelerating line until tile's animation finishes
	or other failsafe triggered (eg going offscreen)
	0x28 bytes
	$04: Delay
	$08: Tile data pointer
	$0C: 
	$10: Y-offset
	$12: X-offset
	$14: Y-speed (movement per frame)
	$16: X-speed (positive is rightward)
	$18: Y-acceleration
	$1A: X-acceleration
	$1C: 
	$20: Affect how the tile is loaded... $20, $21-22, $23 separate params
	$24: Some sort of ending conditions param
		0x80000000: when object leaves coord bounds, reset to starting coords; end when anim finishes
		0x40000000: end when anim finishes, or when object leaves certain coord limits
		(anything else): end when anim finishes

0x12, (used in Holy) - Animate moving tile? One converging to origin point?
	0x28 bytes
	$04: Delay (frames)
	$08: TSA/animation pointer
	$0C: Origin
	$10: Y-offset (hw)
	$12: X-offset
	$14: ?
	

0x13, Animate tile 
	0x28 bytes
	$04: Delay (frames)
	$08: TSA/animation pointer
	$0C: Origin
	$10: Y-offset (hw)
	$12: X-offset
	$14: Some zoom factor? Same as $14 in Chunk 0x17
	$18: ??
	$1C: ??
	$20: ??
	$24: If non-0x1, tile stops animating...
	$26: Layering? If 0x1, tile is drawn beneath PC sprites

0x14, Draw object spiraling in
	0x30 (!) bytes long
	$04: Delay
	$08: Tile data pointer
	$0C: Origin type to base destination coords off of
	$10: Destination Y-coord
	$12: Destination X-coord
	$14: Spiral Y magnitude
	$16: Spiral X magnitude
	$18: ???
	$1C: Direction/distance A and starting position on spiral
	$20: Direction/distance B
		-If A > B, go counterclockwise a distance of A - B
		-If A < B, go clockwise a distance of B - A
		-A's value also determines starting position along the spiral
	
	$24: More zoom params; same 0x10000000 bit to flip horizontally
	$28: Animation mode and flags?
		0x400000: Flicker
	$2C: Total time

0x17, Animate moving tile:
	0x24 bytes long
	$04: Delay, in frames
	$08: Some ROM pointer that affects how the GFX tiles are loaded
	$0C: Origin point type of moving tile, to be modified by coordinates

	$10: Displacement from the origin for the GFX tile to emerge from
		$10-11: Y-coord
		$12-13: X-coord (both are signed)
	$14: Something...displacement after spawning?
	$18: Some GFX params; eg if bit 0x10000000 set, flip horizontally
	$19-1A: loaded as halfword
	$1B: Layer to draw on? (in front of/behind sprites)
	$1C: Path; only values below 0x1F are accepted; indexes to a jump table of routines
		$00: Move in a circle?
		$02: Spiral outwards
		$05: Wobble downwards (fast)
		$06: Wobble down-right (slow)
		$07: Used for Life/Full-Life fairies...cursive L-shaped curve towards target
		$0B: spiral in and circle around a point
		$12: Sway up+down then change
		$16: Move to origin?
		$18: Move to right edge of screen
	$20: Parameter relating to the $1C param; eg destination coords, displacement from target
		$20-21: Y-displacement
		$22-23: X-displacement

0x18, Fade out animated tile?
	0x18 bytes long
	$04: Delay
	$08: ID?
	$10: Some speed param...
	$14: Timer

0x1B, Animate PC target(s)
	0x14 bytes long
	$04: Delay
	$08: PC to animate
		0xFFFFFFFF: All PCs?
		>0x3: Only target PC?
	$0C: Animation to use; 0x6 = damage anim; 0xFFFFFFFF = cancel anims
	$10: How long to run damage anim (0 = indefinite/until canceled)

0x1C, Load fixed tile
	0x10  bytes long
	$04: Anim/Tile data pointer?
	$08: Palette pointer?
	$0C: ?

0x1D, load BG overlay?
	0x18 bytes long
	$04: Delay
	$08: Tile data pointer
	$0C: Y-offset in tile data
	$0E: X-offset in tile data
	$10: ?
	$14: ?

0x1E, Something for the end of anims
	0x08 bytes long
	$04: Delay

0x1F, set anim data for fixed tile?
	0x0C bytes long
	$04: Delay
	$08: Layering?
		0x1 Draw translucently over sprites
		0x2 Draw under sprites
		0x3 Draw, and remove PC sprites!

0x21: Something to do with palettes...loads palette for cycling, sets the params
	0x18 bytes long
	$04: Delay
	$08: Palette pointer
	$0C: Number of frames to play before looping
	$10: Palette/animation cycling speed? Lower is faster
	$14: Total time to pause before moving on

0x23: Draw static animated image?
	0x10 bytes long
	$04: Delay
	$08: Tile data pointer..?
		-Points to a data struct which itself contains GFX pointers, other params
		-Uses GFX data previously loaded in 0x1C commands?


0x24: Restore normal brightness
	0x0C bytes long
	$04: Delay
	$08: Light speed

0x25: Tint entire screen
	0x10 bytes long
	$04: Delay
	$08: Color (0x7FFF is full white)
	$0C: Length of time to tint, in frames

0x26: Tint spell GFX
	0x18 bytes long
	$04: Delay
	$08: ?
	$0C: ?           0xC and 0xC makes a faded tint...

0x27: Darken screen
	0x18 bytes long
	$04: Delay (before beginning)
	$08: Colour (only red?)
	$0C: Intensity
	$10: Flags?
		0x00: Fade BG
		0x01: Fade PCs
		0x02: Fade Monsters
		0x04: Fade spell animation
		0x05: Fade everything?
	$14: Fade speed (frames) - don't move to next command until finished darkening

0x28: Tint screen?
	0x1C bytes long

0x30: Create screen distortion effect (w/ extra BG layer?)
	0x18 bytes long
	$04: Delay
	$08: If nonzero, don't animate
	$0C: Distortion frequency
	$10: Distortion intensity
	$14: What to distort?
		0x00: BG only
		0x01: BG and monsters
		0x02: ?
		0x03: ?

0x31: (used for Kill)
	0x0C bytes long
	$04: Delay
	$08: Some modifier for BG overlay distortion pattern?
		very high values = less distortion

0x32: (used for Kill)
	0x0C bytes long

0x38: (used for Kill)
	-Has to do with BG effect..?
	0x0C bytes long
	$04: Delay
	$08: Y-coord?
	$0A: X-coord?
